<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <meta name="description" content="Partytown Test Page" />
    <title>Window</title>
    <style>
      body {
        font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif,
          Apple Color Emoji, Segoe UI Emoji;
        font-size: 12px;
      }
      h1 {
        margin: 0 0 15px 0;
      }
      ul {
        list-style-type: none;
        margin: 0;
        padding: 0;
      }
      a {
        display: block;
        padding: 16px 8px;
      }
      a:link,
      a:visited {
        text-decoration: none;
        color: blue;
      }
      a:hover {
        background-color: #eee;
      }
      li {
        display: flex;
        margin: 15px 0;
      }
      li strong,
      li code,
      li button {
        white-space: nowrap;
        flex: 1;
        margin: 0 5px;
      }
    </style>
    <script>
      partytown = {
        logCalls: true,
        logGetters: true,
        logSetters: true,
        logStackTraces: false,
        logScriptExecution: true,
      };
    </script>
    <script src="/~partytown/debug/partytown.js"></script>
  </head>
  <body>
    <h1>Window</h1>
    <ul>
      <li>
        <strong>width x height</strong>
        <code>
          <span id="testWidthHeight"></span>
        </code>
        <script type="text/partytown">
          (function () {
            const elm = document.getElementById('testWidthHeight');
            screen.width;
            screen.height;
            screen.width;
            screen.height;
            elm.textContent = `${screen.width}x${screen.height}`;
          })();
        </script>
      </li>

      <li>
        <strong>orientation</strong>
        <code>
          <span id="testOrientation"></span>
        </code>
        <script type="text/partytown">
          (function () {
            const elm = document.getElementById('testOrientation');
            const orientation = screen.orientation;
            if (orientation) {
              // safari doesn't have screen.orientation
              const orientationType = orientation.type;
              elm.textContent = orientationType;
            }
          })();
        </script>
      </li>

      <script type="text/partytown">
        (function () {
          document.body.classList.add('completed');
        })();
      </script>
    </ul>

    <hr />
    <p><a href="/tests/">All Tests</a></p>
  </body>
</html>
